package com.cmc.cloud.cmclink.doc.convert;

import java.util.List;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;import org.mapstruct.Mappings;import org.mapstruct.factory.Mappers;

import com.cmc.cloud.cmclink.doc.api.document.rep.manifestrep.manifest.ManifestCreateReqVO;
import com.cmc.cloud.cmclink.doc.api.document.rep.manifestrep.manifest.ManifestRespVO;
import com.cmc.cloud.cmclink.doc.api.document.rep.manifestrep.manifest.ManifestUpdateReqVO;
import com.cmc.cloud.cmclink.doc.entity.ManifestDO;
import com.cmc.cloud.cmclink.doc.entity.SoDO;

/**
 * 舱单主 Convert
 *
 * @author chenzheng
 */
@Mapper
public interface ManifestConvert {
    /**
     * 获取转换接口的实例
     */
    ManifestConvert INSTANCE = Mappers.getMapper(ManifestConvert.class);

    /**
     * 将创建请求VO转换为DO
     *
     * @param bean 创建请求VO
     * @return DO
     */
    ManifestDO convert(ManifestCreateReqVO bean);

    /**
     * 将创建请求VO转换为DO
     *
     * @param bean 创建请求VO
     * @return DO
     */
    ManifestDO convert(SoDO bean);

    /**
     * 将更新请求VO转换为DO
     *
     * @param bean 更新请求VO
     * @return DO
     */
    ManifestDO convert(ManifestUpdateReqVO bean);

    /**
     * 将DO转换为查询响应VO
     *
     * @param bean DO
     * @return VO
     */
    ManifestRespVO convert(ManifestDO bean);

    /**
     * 将DO列表转换为查询响应VO列表
     *
     * @param list DO列表
     * @return VO List
     */
    List<ManifestRespVO> convertList(List<ManifestDO> list);

    /**
     * 将DO列表转换为查询响应VO列表
     *
     * @param list DO列表
     * @return VO List
     */
    List<com.cmc.cloud.cmclink.doc.vo.manifestvo.manifest.ManifestRespVO> convertRespList(List<ManifestRespVO> list);

    /**
     * 将DO转换为查询响应VO
     *
     * @param bean DO
     * @return VO
     */
    @Mappings(value = {@Mapping(target = "creatorId", source = "creator"),
        @Mapping(target = "creator", source = "creator")})
    com.cmc.cloud.cmclink.doc.vo.manifestvo.manifest.ManifestRespVO convert(ManifestRespVO bean);
}
